package com.adams.sys.shortcut.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.adams.access.db.bean.Shortcut;
import com.adams.access.db.dao.hibernate.HibernateDao;
import com.adams.sys.shortcut.dao.ShortcutDao;

@Repository("shortcutDao")
public class ShortcutDaoImpl extends HibernateDao<Shortcut, Long> implements
		ShortcutDao
{

	@Override
	public List<Shortcut> findByUserId(Long userId)
	{
		return query("from Shortcut where userId=? order by id", userId);
	}

	@Override
	public int deleteByUserId(Long userId)
	{
		return executeUpdate("delete from Shortcut where userId=?", userId);
	}

}
